package controller

import (
	"mini-app/internal/app/admin/service"
	"strconv"

	"192.168.1.75/go-pkg/response"
	"github.com/gin-gonic/gin"
)

type Order struct{}

func (Order) List(c *gin.Context) {
	
	batchID := c.Query("batch_id") // 订单id
	orderStatus, _ := strconv.Atoi(c.Query("order_status"))
	page, _ := strconv.Atoi(c.Query("page"))
	limit, _ := strconv.Atoi(c.Query("limit"))
	list, total, err := service.Order{}.List(c.Request.Context(), batchID, orderStatus, page, limit)
	response.JSON(c, gin.H{
		"list":  list,
		"total": total,
	}, err)
}
